<?php

class videometadata extends model {

	public function getTitle($dynamic = true) {
		if ($dynamic === false) {
			return $this->get("title");
		}
		$sql = "SELECT IF( mb_similar > ".config::getInstance()->musicbrainz_min_similar.", mb_title, parsed_title) AS title 
			FROM `videometadata` 
			WHERE id = '".$this->getId()."'";
		return $this->sqlOne($sql);
	}
	
	public function getArtist($dynamic = true) {
		if ($dynamic === false) {
			return $this->get("artist");
		}
		$sql = "SELECT IF( mb_similar > ".config::getInstance()->musicbrainz_min_similar.", mb_artist, parsed_artist) AS artist 
			FROM `videometadata` 
			WHERE id = '".$this->getId()."'";
		return $this->sqlOne($sql);
	}
	
}

?>